home *** CD-ROM | disk | FTP | other *** search
/ Scene Storm / Scene Storm - Volume 1.iso / coding / c / bsprite / main.c < prev    next >
C/C++ Source or Header  |  1995-12-31  |  2KB  |  80 lines

  1. /* BorderBlank par Leu Simon GRIS le 16.8.95 */
  2.  
  3. #define SYSBASE struct ExecBase * SysBase = (*((struct ExecBase **) 4))
  4.  
  5. #define __USE_SYSBASE
  6.  
  7. #include <dos/dos.h>
  8. #include <dos/dosextens.h>
  9.  
  10. #include <workbench/startup.h>
  11.  
  12. #include <exec/exec.h>
  13. #include <proto/exec.h>
  14.  
  15. #include <graphics/GfxBase.h>
  16. #include <proto/graphics.h>
  17.  
  18. #include <intuition/intuition.h>
  19. #include <proto/intuition.h>
  20.  
  21. #include <hardware/custom.h>
  22.  
  23. LONG Main(void);
  24.  
  25. #ifdef BORDERSPRITE
  26. static char Verstag[] = "\0$VER: BSprite 1.0 (16.8.95) by Leu Simon Gris";
  27. #endif
  28. #ifdef BORDERBLANK
  29. static char Verstag[] = "\0$VER: BBlank 1.0 (16.8.95) by Leu Simon Gris";
  30. #endif
  31.  
  32. __saveds LONG Main(void)
  33. {
  34.     SYSBASE;
  35.     struct Process          *nous;
  36.     struct MsgPort          *msgPort;
  37.     struct WBStartup        *wBStartup;
  38.     struct GfxBase          *GfxBase;
  39.     struct IntuitionBase    *IntuitionBase;
  40.     LONG                    returncode = RETURN_FAIL;
  41.  
  42.     nous = (struct Process *)(SysBase->ThisTask);
  43.  
  44.     if( nous->pr_CLI == NULL )
  45.     {
  46.         msgPort = &(nous->pr_MsgPort);
  47.         WaitPort(msgPort);
  48.         wBStartup = (struct WBStartup*)GetMsg(msgPort);
  49.     }
  50.  
  51.     GfxBase = (struct GfxBase*)OpenLibrary("graphics.library",39);
  52.     if( GfxBase != NULL )
  53.     {
  54.         IntuitionBase = (struct IntuitionBase*)
  55.                         OpenLibrary("intuition.library",0);
  56.         if( IntuitionBase != NULL )
  57.         {
  58. #ifdef BORDERSPRITE
  59.             GfxBase->BP3Bits ^= BPLCON3_EXTBLKZD;
  60. #endif
  61. #ifdef BORDERBLANK
  62.             GfxBase->BP3Bits ^= BPLCON3_BRDNBLNK;
  63. #endif
  64.             RemakeDisplay();
  65.             returncode = RETURN_OK;
  66.             CloseLibrary((struct Library *)IntuitionBase);
  67.         }
  68.         CloseLibrary((struct Library *)GfxBase);
  69.     }
  70.  
  71.     if( nous->pr_CLI == NULL )
  72.     {
  73.         Forbid();
  74.         ReplyMsg((struct Message *)wBStartup);
  75.     }
  76.  
  77.     return(returncode);
  78. }
  79.  
  80.